<section class="content-header">
	<h1>
		測試功能
		<small>数据维护</small>
	</h1>
</section>
<section class="content" xmlns:th="http://www.thymeleaf.org">
	<div class="row">
    	<div class="col-xs-12">
        	<div class="box">
	            <div class="box-body">
		            <form id="demoTestForm" role="form" class="form-horizontal">
						<div class="form-group">
							<label class="col-md-3 control-label">名称:</label>
							<div class="col-md-5">
								<input type="text" name="name" class="form-control" th:value="${demoTest?.name}" required="required" maxlength="100"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">年龄:</label>
							<div class="col-md-5">
								<input type="text" name="age" class="form-control" th:value="${demoTest?.age}"  maxlength="10"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">出生日期:</label>
							<div class="col-md-5">
								<input type="text" name="birthday" class="form-control datepicker"
					        	th:value="${#dates.format(demoTest?.birthday, 'yyyy-MM-dd')}"  readonly="readonly"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">部门:</label>
							<div class="col-md-5">
								<select name="deptId" class="form-control" th:value="${demoTest?.deptId}" >
									<option value="">请选择</option>
									<option value="1" th:selected="${demoTest?.deptId == '1'}">Option 1</option>
									<option value="2" th:selected="${demoTest?.deptId == '2'}">Option 2</option>
									<option value="3" th:selected="${demoTest?.deptId == '3'}">Option 3</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">性别:</label>
							<div class="col-md-5">
								<div class="radio-list">
									<!-- <label class="radio-inline c-radio">
										<input type="radio" name="sex" value="1" th:checked="${demoTest?.sex == '1' || demoTest == null}"/>
										<i class="fa fa-check"></i> Option 1 
									</label>
									<label class="radio-inline c-radio">
										<input type="radio" name="sex" value="2" th:checked="${demoTest?.sex == '2'}"/>
										<i class="fa fa-check"></i> Option 2 
									</label> -->
									<label class="radio-inline c-radio" th:each="sex : ${sexs}">
										<input type="radio" name="sex" th:value="${sex.code}" 
											th:checked="${demoTest?.sex == sex.code || (sex.code == '1' && demoTest == null)}">
										<i class="fa fa-check"></i> <span th:text="${sex.name}"></span>
									</label>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">爱好:</label>
							<div class="col-md-5">
								<div class="checkbox-list">
									<label class="checkbox-inline c-checkbox">
										<input type="checkbox" name="hobby" value="1"/>
										<i class="fa fa-check"></i> Checkbox 1 
									</label>
									<label class="checkbox-inline c-checkbox">
										<input type="checkbox" name="hobby" value="2"/>
										<i class="fa fa-check"></i> Checkbox 2 
									</label>
									<label class="checkbox-inline c-checkbox">
										<input type="checkbox" name="hobby" value="3"/>
										<i class="fa fa-check"></i> Checkbox 3 
									</label>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 control-label">描述:</label>
							<div class="col-md-5">
								<textarea name="remark" class="form-control" rows="5" th:text="${demoTest?.remark}"  maxlength="255"></textarea>
							</div>
						</div>
					    <input type="hidden" name="demoId" th:value="${demoTest?.demoId}"/>
		            </form>
	            </div>
	            <div class="box-footer">
	            	<div class="col-md-9 col-md-offset-3">
						<button type="button" class="btn btn-primary" onclick="save()">保存</button>
			          	<button type="button" class="btn btn-default" onclick="forwardPage('/demoTest/init')">取消</button>
			        </div>
	            </div>
	        </div>
		</div>
	</div>
	<script th:src="@{/js/demo/demoTest/demoTest.js}"></script>
</section>